#pragma once
#include <wx/wx.h>
#include <wx/wxsqlite3.h>
#include "common.h"
#include "dictdb.h"

class DictDBUtils {
    public:
        DictDBUtils(const wxString& dictdb_path);
        virtual ~DictDBUtils();
        
        int rm_indexes();
        
        int mk_indexes();
        
        int mk_tables();
        
        void begin() { _dictdb.Begin(); }
        void commit() { _dictdb.Commit(); }
        void rollback() { _dictdb.Rollback(); }
        
        int add_dict_info(const DictInfo& dictinfo);
        
        bool add_word_to_dict(int d_id, const wxString& w_word, const wxString& e_expl);
        
    protected:
        wxSQLite3Database _dictdb;
};
